#pragma once

#include "PointCloud.h"

namespace PCS
{
	namespace Core
	{		
		class PointCloudPatch
			: public PointCloud
		{
		public:
			enum patch_type {
				surface,
				edge,
				unknown
			};

		private:			
			patch_type T;			
			std::vector<PointCloudPatch*>* m_neighbours;
			int m_id;			

		public:	
			PointCloudPatch(void) : PointCloud() {			
				m_id = -1;
			}

			PointCloudPatch(patch_type& p_type, int p_id, const std::string& p_strName) : PointCloud(p_strName) {
				m_neighbours = new std::vector<PointCloudPatch*>();
				T = p_type;
				m_id = p_id;				
			}

			~PointCloudPatch(void) {
				for (std::vector<Point*>::iterator pointIterator = m_points.begin();
					 pointIterator != m_points.end(); ++pointIterator)
				{
					delete *pointIterator;
				}

				m_points.clear();
			}

			void AddNeighbour(PointCloudPatch * p_pointCloudPatch) {
				m_neighbours->push_back(p_pointCloudPatch);
			}

			std::vector<PointCloudPatch*>* GetNeighbours() {
				return m_neighbours;
			}

			std::string ToString(void) { return boost::str(boost::format("PCPatch # : %d, BV : %s") % m_points.size() % m_pBoundingBox->ToString()); }

		};

		
	}
}